package com.leadnews.mapper;

import com.leadnews.pojo.NovelContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author 自己
* @description 针对表【novel_content】的数据库操作Mapper
* @createDate 2022-12-04 17:02:14
* @Entity com.leadnews.pojo.NovelContent
*/
public interface NovelContentMapper extends BaseMapper<NovelContent> {
    @Select("SELECT n.* FROM novel_content n where n.title=#{s1} and n.novel_id=(select id from novel where name=#{s})")
    NovelContent findByIdAndTitle(@Param("s") String s, @Param("s1") String s1);
    @Select("SELECT n.* from novel_content n where n.id=(SELECT id from novel_content where title=#{s1} and novel_id=(select id from novel where name=#{s}))+1")
    NovelContent findNext(@Param("s")String s,@Param("s1") String s1);
//    @Delete("delete from novel_content where novel_id=#{id}")
//    void deleteByid(@Param("id") String id);
}




